<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AIfES 2: Main page</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="AIfES_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">AIfES 2
   &#160;<span id="projectnumber">2.0.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('index.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="PageDoc"><div class="header">
  <div class="headertitle">
<div class="title">Main page </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p><a class="anchor" id="MainPage"></a> Welcome to the official AIfES 2 documentation! This guideline should give you an overview of the functions and the application of AIfES. The recommendations are based on best practices from various sources and our own experiences in the use of neural networks.</p>
<h1><a class="anchor" id="autotoc_md0"></a>
Vocabulary and Abbreviations</h1>
<ul>
<li><b>AIfES</b>: Artificial Intelligence for Embedded Systems</li>
<li><b>ANN</b>: Artificial Neural Network</li>
<li><b>FNN</b>: Feedforward Neural Network (used in this documentation for simple multi-layer perceptrons)</li>
<li><b>RNN</b>: Recurrent Neural Network</li>
<li><b>CNN</b>: Convolutional Neural Network</li>
<li><b>Inference</b>: The calculation of an ANN (foreward pass / prediction)</li>
<li><b>Backpropagation</b>: A training algorithm for ANNs that is based on gradient descent</li>
</ul>
<h1><a class="anchor" id="autotoc_md1"></a>
Overview (Documentation)</h1>
<ul>
<li><a class="el" href="_tutorial_inference_f32.html">Tutorial inference F32</a>: Guides you through the necessary steps to perform an inference with AIfES, based on an example. (Float 32 model)</li>
<li><a class="el" href="_tutorial_training_f32.html">Tutorial training F32</a>: Guides you through the training process with AIfES, based on an example. (Float 32 model)</li>
<li><a class="el" href="_tutorial_inference_q7.html">Tutorial inference Q7</a>: Guides you through the necessary steps to perform an inference with AIfES, based on an example. (Int 8 model)</li>
</ul>
<h1><a class="anchor" id="OverviewFeatures"></a>
Overview (Features)</h1>
<p>AIfES 2 is a modular toolbox designed to enable developers to execute and train an ANN on resource constrained edge devices as efficient as possible with as little programming effort as possible. The structure is closely based on python libraries such as keras and pytorch to make it easier to get started with the library.</p>
<p>The AIfES basic module contains currently the following features:</p>
<h2><a class="anchor" id="autotoc_md2"></a>
Data types</h2>
<ul>
<li><a class="el" href="aimath__f32_8h.html">F32 </a> (32 bit floating point values)</li>
<li><a class="el" href="aimath__q31_8h.html">Q31 </a> (32 bit quantized fixed point values)</li>
<li><a class="el" href="aimath__q7_8h.html">Q7 </a> (8 bit quantized fixed point values)</li>
</ul>
<h2><a class="anchor" id="autotoc_md3"></a>
General</h2>
<ul>
<li><a class="el" href="aialgo__sequential__inference_8h.html#a3fb665166082f1e7a89e23218a105ce8" title="Initialize the model structure.">aialgo_compile_model()</a></li>
<li><b>Q7 specific</b><ul>
<li><a class="el" href="aialgo__sequential__inference_8h.html#a07f280b3565ec1b02f00d907a2834940" title="Quantize model parameters (weights and bias)">aialgo_quantize_model_f32_to_q7()</a></li>
</ul>
</li>
<li><b>Debug prints</b><ul>
<li><a class="el" href="aialgo__sequential__inference_8h.html#a3bb5fdb556c51ad8b3043d220f0a1276" title="Print the layer structure of the model with the configured parameters.">aialgo_print_model_structure()</a></li>
<li><a class="el" href="aialgo__sequential__training_8h.html#ab19a3d00e7ac130806780cc90e317a09" title="Print the loss specs.">aialgo_print_loss_specs()</a></li>
<li><a class="el" href="aialgo__sequential__training_8h.html#aa0a7ab4189d2f68c675d42aa687758e6" title="Print the optimizer specs.">aialgo_print_optimizer_specs()</a></li>
</ul>
</li>
</ul>
<h2><a class="anchor" id="OverviewInference"></a>
For Inference</h2>
<p><b>Layer:</b></p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadNone">Layer   </th><th class="markdownTableHeadNone">f32   </th><th class="markdownTableHeadNone">q31   </th><th class="markdownTableHeadNone">q7    </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><a class="el" href="ailayer__dense_8h.html">Dense </a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__dense__default_8h.html#a5f58ad071502178879dccb0acab8b74b" title="Initializes and connect a Dense layer  with the F32  default implementation.">ailayer_dense_f32_default()</a><br  />
<a class="el" href="ailayer__dense__cmsis_8h.html#ae4d838f2bde7df2c469aac4ac6a15a46" title="Initializes and connect a Dense layer with the F32  CMSIS implementation.">ailayer_dense_f32_cmsis()</a><br  />
<a class="el" href="ailayer__dense__avr__pgm_8h.html#a1b989bfc9a5480568ec1800c995eb063" title="Initializes and connect a Dense layer  with the F32  AVR PGM implementation.">ailayer_dense_f32_avr_pgm()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__dense__default_8h.html#a65a027083aa5dc87b78d52f00fd48e76" title="Initializes and connect a Dense layer  with the Q31  default implementation.">ailayer_dense_q31_default()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__dense__default_8h.html#a039ecc8141aac279c2d09d79443a2717" title="Initializes and connect a Dense layer  with the Q7  default implementation.">ailayer_dense_q7_default()</a><br  />
<a class="el" href="ailayer__dense__default_8h.html#acd55d4485ba046577ccbb0a2f314ae34" title="Initializes and connect a Dense layer  with the Q7  default implementation for transposed weights ten...">ailayer_dense_wt_q7_default()</a><br  />
<a class="el" href="ailayer__dense__cmsis_8h.html#a4ced6d503f0f851d90050b344f47c638" title="Initializes and connect a Dense layer  with the Q7  AMR CMSIS implementation for transposed weights t...">ailayer_dense_wt_q7_cmsis()</a><br  />
<a class="el" href="ailayer__dense__avr__pgm_8h.html#a8b92ee421b5dc51909e96a7a0bae93b8" title="Initializes and connect a Dense layer  with the Q7  AVR PGM implementation.">ailayer_dense_q7_avr_pgm()</a><br  />
<a class="el" href="ailayer__dense__avr__pgm_8h.html#ae99d06b3b85bbb94a6dd58c4e3760a02" title="Initializes and connect a Dense layer  with the Q7  AVR PGM implementation.">ailayer_dense_wt_q7_avr_pgm()</a>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone"><a class="el" href="ailayer__input_8h.html">Input </a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__input__default_8h.html#af7bb369ff05cf9cca9fda5765a951c79" title="Initializes and connect an Input layer  with the F32  default implementation.">ailayer_input_f32_default()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__input__default_8h.html#a2fb3bf141c5f3f63ee75b8627dc03ee3" title="Initializes and connect an Input layer  with the Q31  default implementation.">ailayer_input_q31_default()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__input__default_8h.html#a20e15725d131ac1488c236994add73dd" title="Initializes and connect an Input layer  with the Q7  default implementation.">ailayer_input_q7_default()</a>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><a class="el" href="ailayer__relu_8h.html">ReLU </a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__relu__default_8h.html#aa5997c9081cc6a6d1bf11154e4062526" title="Initializes and connect a ReLU layer  with the F32  default implementation.">ailayer_relu_f32_default()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__relu__default_8h.html#a1c81d668775b7729451aaced412206da" title="Initializes and connect a ReLU layer  with the Q31  default implementation.">ailayer_relu_q31_default()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__relu__default_8h.html#a4c88d45b618f28ebcfb3e84c00ca4e06" title="Initializes and connect a ReLU layer  with the Q7  default implementation.">ailayer_relu_q7_default()</a><br  />
<a class="el" href="ailayer__relu__avr__pgm_8h.html#ac34eb942e23f9e6786aa5a6acad21b8d" title="Initializes and connect a ReLU layer  with the Q7  AVR PGM implementation.">ailayer_relu_q7_avr_pgm()</a>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone"><a class="el" href="ailayer__sigmoid_8h.html">Sigmoid </a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__sigmoid__default_8h.html#a1ec45b121e81b85e2109f0072d46f602" title="Initializes and connect a Sigmoid layer  with the F32  default implementation.">ailayer_sigmoid_f32_default()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__sigmoid__default_8h.html#a4174af2abb3a361144f00ba7521ee114" title="Initializes and connect a Sigmoid layer  with the Q31  default implementation.">ailayer_sigmoid_q31_default()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__sigmoid__default_8h.html#ad6c8e7d5957c33998ab12847b651e263" title="Initializes and connect a Sigmoid layer  with the Q7  default implementation.">ailayer_sigmoid_q7_default()</a><br  />
<a class="el" href="ailayer__sigmoid__avr__pgm_8h.html#a8c5b9369bc78a5c2c70ab21877d860e4" title="Initializes and connect a Sigmoid layer  with the Q7  AVR PGM implementation.">ailayer_sigmoid_q7_avr_pgm()</a>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><a class="el" href="ailayer__softmax_8h.html">Softmax </a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__softmax__default_8h.html#a3a89bb8691ee208550e0b267355679ea" title="Initializes and connect an Softmax layer  with the F32  default implementation.">ailayer_softmax_f32_default()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__softmax__default_8h.html#aabdf9e2b722406165c4e28a0c8c29a18" title="Initializes and connects an Softmax layer  with the Q31  default implementation.">ailayer_softmax_q31_default()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__softmax__default_8h.html#a469403b690f21b4025bd5443bf6af11d" title="Initializes and connects an Softmax layer  with the Q7  default implementation.">ailayer_softmax_q7_default()</a><br  />
<a class="el" href="ailayer__softmax__avr__pgm_8h.html#ad8b7643c2fa2e9310dc516935f86fca6" title="Initializes and connect a Softmax layer  with the Q7  AVR PGM implementation.">ailayer_softmax_q7_avr_pgm()</a>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone"><a class="el" href="ailayer__leaky__relu_8h.html">Leaky ReLU </a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__leaky__relu__default_8h.html#aecb15e9008d56b41a8370d9f38cde60c" title="Initializes and connect a Leaky ReLU layer  with the F32  default implementation.">ailayer_leaky_relu_f32_default()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__leaky__relu__default_8h.html#abce9a41a7af66747f779440124c04977" title="Initializes and connect a Leaky ReLU layer  with the Q31  default implementation.">ailayer_leaky_relu_q31_default()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__leaky__relu__default_8h.html#a85b42fd39716f57363a770edca84381d" title="Initializes and connect a Leaky ReLU layer  with the Q7  default implementation.">ailayer_leaky_relu_q7_default()</a><br  />
<a class="el" href="ailayer__leaky__relu__avr__pgm_8h.html#ae5ad04e45e260f5817fff1d0f1da8ab9" title="Initializes and connect a Leaky ReLU layer  with the Q7  AVR PGM implementation.">ailayer_leaky_relu_q7_avr_pgm()</a>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><a class="el" href="ailayer__elu_8h.html">ELU </a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__elu__default_8h.html#a900c91cf2ec9e7a51a94312d03ee2e55" title="Initializes and connect an ELU layer  with the F32  default implementation.">ailayer_elu_f32_default()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__elu__default_8h.html#a4f1252f1f417e8a3ddf26aa7f071ffa0" title="Initializes and connect a ELU layer  with the Q31  default implementation.">ailayer_elu_q31_default()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__elu__default_8h.html#a5d6993fd796ae43be0964f08a2e2278e" title="Initializes and connect a ELU layer  with the Q7  default implementation.">ailayer_elu_q7_default()</a><br  />
<a class="el" href="ailayer__elu__avr__pgm_8h.html#ab175c243d9071b2484eb3ef96abeebc7" title="Initializes and connect a ELU layer  with the Q7  AVR PGM implementation.">ailayer_elu_q7_avr_pgm()</a>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone"><a class="el" href="ailayer__tanh_8h.html">Tanh </a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__tanh__default_8h.html#a80b4a962ca942bf21c936b66ea8ad948" title="Initializes and connect an Tanh layer  with the F32  default implementation.">ailayer_tanh_f32_default()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__tanh__default_8h.html#a07522d6a43bd3ee674737697fcf191a6" title="Initializes and connect a Tanh layer  with the Q31  default implementation.">ailayer_tanh_q31_default()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__tanh__default_8h.html#ac27a188a1d716d8d1fa04469bdeccc87" title="Initializes and connect a Tanh layer  with the Q7  default implementation.">ailayer_tanh_q7_default()</a><br  />
<a class="el" href="ailayer__tanh__avr__pgm_8h.html#aec0b62504938d3fa5bc936a02d8bf0bc" title="Initializes and connect a Tanh layer  with the Q7  AVR PGM implementation.">ailayer_tanh_q7_avr_pgm()</a>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><a class="el" href="ailayer__softsign_8h.html">Softsign </a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__softsign__default_8h.html#a61bd457b1738a257f9adfd4130246c16" title="Initializes and connect a Softsign layer  with the F32  default implementation.">ailayer_softsign_f32_default()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__softsign__default_8h.html#ad73c4997f1ece486930de9f1f5066b34" title="Initializes and connect a Softsign layer  with the Q31  default implementation.">ailayer_softsign_q31_default()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__softsign__default_8h.html#adc181fff8c1a26defd81592b9818edc7" title="Initializes and connect a Softsign layer  with the Q7  default implementation.">ailayer_softsign_q7_default()</a><br  />
<a class="el" href="ailayer__softsign__avr__pgm_8h.html#a75acc2532a0fcb328742281f845f2d8e" title="Initializes and connect a Softsign layer  with the Q7  AVR PGM implementation.">ailayer_softsign_q7_avr_pgm()</a>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone"><a class="el" href="ailayer__conv2d_8h.html">Conv2D </a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__conv2d__default_8h.html#abdf2ea191fddeb926d4711e0b1c21e1b" title="Initializes and connect a Conv2D layer  with the F32  default implementation.">ailayer_conv2d_f32_default()</a>   </td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><a class="el" href="ailayer__batch__normalization_8h.html">Batch Normalization </a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__batch__normalization__default_8h.html#a0c2e41aa208383db3214b3d501269d29" title="Initializes and connect a Batch Normalization layer  with the F32  default implementation.">ailayer_batch_norm_f32_default()</a>   </td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone"><a class="el" href="ailayer__maxpool2d_8h.html">MaxPool2D </a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__maxpool2d__default_8h.html#a0d91a429f97af0ab05e308348824c7bd" title="Initializes and connect a Conv2D layer  with the F32  default implementation.">ailayer_maxpool2d_f32_default()</a>   </td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><a class="el" href="ailayer__reshape_8h.html">Reshape </a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__reshape__default_8h.html#a9ec8fab68e0e4e5403b4fef7a2b7a833" title="Initializes and connect a Reshape layer  with the F32  default implementation.">ailayer_reshape_f32_default()</a>   </td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone"><a class="el" href="ailayer__reshape_8h.html">Flatten </a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__reshape__default_8h.html#a3dd617ab45d72da99086305b39f15cc1" title="Initializes and connect a Flatten layer  with the F32  default implementation.">ailayer_flatten_f32_default()</a>   </td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td></tr>
</table>
<p><b>Algorithmic:</b></p>
<ul>
<li><b>Inference memory</b> (required for intermediate results of an inference)<ul>
<li><a class="el" href="aialgo__sequential__inference_8h.html#a877ce6eee19a9f9bcbdb115d83537e68" title="Calculate the memory requirements for intermediate results of an inference.">aialgo_sizeof_inference_memory()</a></li>
<li><a class="el" href="aialgo__sequential__inference_8h.html#a7cbfac6a46c02107d19af7c8f6e5469a" title="Assign the memory for intermediate results of an inference to the model.">aialgo_schedule_inference_memory()</a></li>
</ul>
</li>
<li><a class="el" href="aialgo__sequential__inference_8h.html#a295cb2bb6c3fefc478042f66e067e090" title="Perform an inference on the model / Run the model.">aialgo_inference_model()</a></li>
<li><b>Advanced inference controls</b><ul>
<li><a class="el" href="aialgo__sequential__inference_8h.html#a4655caab3051cc837312c286fbe4789a" title="Perform a forward pass on the model.">aialgo_forward_model()</a></li>
</ul>
</li>
</ul>
<h2><a class="anchor" id="OverviewTraining"></a>
For Training</h2>
<p><b>Layer:</b></p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadNone">Layer   </th><th class="markdownTableHeadNone">f32   </th><th class="markdownTableHeadNone">q31   </th><th class="markdownTableHeadNone">q7    </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><a class="el" href="ailayer__dense_8h.html">Dense </a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__dense__default_8h.html#a5f58ad071502178879dccb0acab8b74b" title="Initializes and connect a Dense layer  with the F32  default implementation.">ailayer_dense_f32_default()</a><br  />
<a class="el" href="ailayer__dense__cmsis_8h.html#ae4d838f2bde7df2c469aac4ac6a15a46" title="Initializes and connect a Dense layer with the F32  CMSIS implementation.">ailayer_dense_f32_cmsis()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__dense__default_8h.html#a65a027083aa5dc87b78d52f00fd48e76" title="Initializes and connect a Dense layer  with the Q31  default implementation.">ailayer_dense_q31_default()</a>   </td><td class="markdownTableBodyNone"></td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone"><a class="el" href="ailayer__input_8h.html">Input </a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__input__default_8h.html#af7bb369ff05cf9cca9fda5765a951c79" title="Initializes and connect an Input layer  with the F32  default implementation.">ailayer_input_f32_default()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__input__default_8h.html#a2fb3bf141c5f3f63ee75b8627dc03ee3" title="Initializes and connect an Input layer  with the Q31  default implementation.">ailayer_input_q31_default()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__input__default_8h.html#a20e15725d131ac1488c236994add73dd" title="Initializes and connect an Input layer  with the Q7  default implementation.">ailayer_input_q7_default()</a>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><a class="el" href="ailayer__relu_8h.html">ReLU </a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__relu__default_8h.html#aa5997c9081cc6a6d1bf11154e4062526" title="Initializes and connect a ReLU layer  with the F32  default implementation.">ailayer_relu_f32_default()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__relu__default_8h.html#a1c81d668775b7729451aaced412206da" title="Initializes and connect a ReLU layer  with the Q31  default implementation.">ailayer_relu_q31_default()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__relu__default_8h.html#a4c88d45b618f28ebcfb3e84c00ca4e06" title="Initializes and connect a ReLU layer  with the Q7  default implementation.">ailayer_relu_q7_default()</a>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone"><a class="el" href="ailayer__sigmoid_8h.html">Sigmoid </a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__sigmoid__default_8h.html#a1ec45b121e81b85e2109f0072d46f602" title="Initializes and connect a Sigmoid layer  with the F32  default implementation.">ailayer_sigmoid_f32_default()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__sigmoid__default_8h.html#a4174af2abb3a361144f00ba7521ee114" title="Initializes and connect a Sigmoid layer  with the Q31  default implementation.">ailayer_sigmoid_q31_default()</a>   </td><td class="markdownTableBodyNone"></td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><a class="el" href="ailayer__softmax_8h.html">Softmax </a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__softmax__default_8h.html#a3a89bb8691ee208550e0b267355679ea" title="Initializes and connect an Softmax layer  with the F32  default implementation.">ailayer_softmax_f32_default()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__softmax__default_8h.html#aabdf9e2b722406165c4e28a0c8c29a18" title="Initializes and connects an Softmax layer  with the Q31  default implementation.">ailayer_softmax_q31_default()</a>   </td><td class="markdownTableBodyNone"></td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone"><a class="el" href="ailayer__leaky__relu_8h.html">Leaky ReLU </a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__leaky__relu__default_8h.html#aecb15e9008d56b41a8370d9f38cde60c" title="Initializes and connect a Leaky ReLU layer  with the F32  default implementation.">ailayer_leaky_relu_f32_default()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__leaky__relu__default_8h.html#abce9a41a7af66747f779440124c04977" title="Initializes and connect a Leaky ReLU layer  with the Q31  default implementation.">ailayer_leaky_relu_q31_default()</a>   </td><td class="markdownTableBodyNone"></td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><a class="el" href="ailayer__elu_8h.html">ELU </a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__elu__default_8h.html#a900c91cf2ec9e7a51a94312d03ee2e55" title="Initializes and connect an ELU layer  with the F32  default implementation.">ailayer_elu_f32_default()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__elu__default_8h.html#a4f1252f1f417e8a3ddf26aa7f071ffa0" title="Initializes and connect a ELU layer  with the Q31  default implementation.">ailayer_elu_q31_default()</a>   </td><td class="markdownTableBodyNone"></td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone"><a class="el" href="ailayer__tanh_8h.html">Tanh </a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__tanh__default_8h.html#a80b4a962ca942bf21c936b66ea8ad948" title="Initializes and connect an Tanh layer  with the F32  default implementation.">ailayer_tanh_f32_default()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__tanh__default_8h.html#a07522d6a43bd3ee674737697fcf191a6" title="Initializes and connect a Tanh layer  with the Q31  default implementation.">ailayer_tanh_q31_default()</a>   </td><td class="markdownTableBodyNone"></td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><a class="el" href="ailayer__softsign_8h.html">Softsign </a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__softsign__default_8h.html#a61bd457b1738a257f9adfd4130246c16" title="Initializes and connect a Softsign layer  with the F32  default implementation.">ailayer_softsign_f32_default()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__softsign__default_8h.html#ad73c4997f1ece486930de9f1f5066b34" title="Initializes and connect a Softsign layer  with the Q31  default implementation.">ailayer_softsign_q31_default()</a>   </td><td class="markdownTableBodyNone"></td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone"><a class="el" href="ailayer__conv2d_8h.html">Conv2D </a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__conv2d__default_8h.html#abdf2ea191fddeb926d4711e0b1c21e1b" title="Initializes and connect a Conv2D layer  with the F32  default implementation.">ailayer_conv2d_f32_default()</a>   </td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><a class="el" href="ailayer__batch__normalization_8h.html">Batch Normalization </a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__batch__normalization__default_8h.html#a0c2e41aa208383db3214b3d501269d29" title="Initializes and connect a Batch Normalization layer  with the F32  default implementation.">ailayer_batch_norm_f32_default()</a>   </td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone"><a class="el" href="ailayer__maxpool2d_8h.html">MaxPool2D </a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__maxpool2d__default_8h.html#a0d91a429f97af0ab05e308348824c7bd" title="Initializes and connect a Conv2D layer  with the F32  default implementation.">ailayer_maxpool2d_f32_default()</a>   </td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><a class="el" href="ailayer__reshape_8h.html">Reshape </a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__reshape__default_8h.html#a9ec8fab68e0e4e5403b4fef7a2b7a833" title="Initializes and connect a Reshape layer  with the F32  default implementation.">ailayer_reshape_f32_default()</a>   </td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone"><a class="el" href="ailayer__reshape_8h.html">Flatten </a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailayer__reshape__default_8h.html#a3dd617ab45d72da99086305b39f15cc1" title="Initializes and connect a Flatten layer  with the F32  default implementation.">ailayer_flatten_f32_default()</a>   </td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td></tr>
</table>
<p><b>Loss:</b></p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadNone">Loss   </th><th class="markdownTableHeadNone">f32   </th><th class="markdownTableHeadNone">q31   </th><th class="markdownTableHeadNone">q7    </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><a class="el" href="ailoss__mse_8h.html">Mean Squared Error (MSE) </a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailoss__mse__default_8h.html#a20b7e226622843064be672c3ad2949c8" title="Initializes and connect a Mean Squared Error loss  with the F32  default implementation using a mean ...">ailoss_mse_f32_default()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailoss__mse__default_8h.html#a872210d1ce418bff7d7296cd9eec603f" title="Initializes and connect a Mean Squared Error loss  with the Q31  default implementation using a mean ...">ailoss_mse_q31_default()</a>   </td><td class="markdownTableBodyNone"></td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone"><a class="el" href="ailoss__crossentropy_8h.html">Crossentropy </a>   </td><td class="markdownTableBodyNone"><a class="el" href="ailoss__crossentropy__default_8h.html#aa10b5c43deef1891d98cb8c45d57b3ee" title="Initializes and connect a Cross-Entropy loss  with the F32  default implementation using a mean reduc...">ailoss_crossentropy_f32_default()</a><br  />
<a class="el" href="ailoss__crossentropy__default_8h.html#a01f977cc97f44940f402462686e13de3" title="Initializes and connect a Cross-Entropy loss  with the F32  default implementation for sparse labels ...">ailoss_crossentropy_sparse8_f32_default()</a>   </td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td></tr>
</table>
<p><b>Optimizer:</b></p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadNone">Optimizer   </th><th class="markdownTableHeadNone">f32   </th><th class="markdownTableHeadNone">q31   </th><th class="markdownTableHeadNone">q7    </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><a class="el" href="aiopti__sgd_8h.html">Stochastic Gradient Descent (SGD) </a>   </td><td class="markdownTableBodyNone"><a class="el" href="aiopti__sgd__default_8h.html#a03d6b243e9d19878cf5c4d53c6e892ce" title="Initializes a SGD optimizer  with the F32  default implementation.">aiopti_sgd_f32_default()</a>   </td><td class="markdownTableBodyNone"><a class="el" href="aiopti__sgd__default_8h.html#a68b634f26ac2d6408ea8f75487fed03b" title="Initializes a SGD optimizer  with the Q31  default implementation.">aiopti_sgd_q31_default()</a>   </td><td class="markdownTableBodyNone"></td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone"><a class="el" href="aiopti__adam_8h.html">Adam </a>   </td><td class="markdownTableBodyNone"><a class="el" href="aiopti__adam__default_8h.html#a403603bdc0d77e2d1cbc3fd4cd37880a" title="Initializes an Adam optimizer  with the F32  default implementation.">aiopti_adam_f32_default()</a>   </td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td></tr>
</table>
<p><b>Algorithmic:</b></p>
<ul>
<li><b>Parameter memory</b> (required for the trainable parameters like weights, bias etc. if there are no pre-trained parameters)<ul>
<li><a class="el" href="aialgo__sequential__inference_8h.html#acdf3763b8fe9047446ddbcfdbdae5570" title="Calculate the memory requirements for the trainable parameters (like weights, bias,...">aialgo_sizeof_parameter_memory()</a></li>
<li><a class="el" href="aialgo__sequential__inference_8h.html#a26db68cb4231b534b03c649d6eeab3f8" title="Assign the memory for the trainable parameters (like weights, bias, ...) of the model.">aialgo_distribute_parameter_memory()</a></li>
</ul>
</li>
<li><b>Training memory</b> (required for example for gradients, momentums and intermediate results of the training)<ul>
<li><a class="el" href="aialgo__sequential__training_8h.html#aaa72bf9da57a600c0d4fef4ba03f725e" title="Calculate the memory requirements for model training.">aialgo_sizeof_training_memory()</a></li>
<li><a class="el" href="aialgo__sequential__training_8h.html#aa6ae098c2add3651d216724f102e931b" title="Assign the memory for model training.">aialgo_schedule_training_memory()</a></li>
</ul>
</li>
<li><a class="el" href="aialgo__sequential__training_8h.html#ab6ea378b18812cf68fb4ae70c57380a5" title="Initialize the parameters of the given model with their default initialization method.">aialgo_initialize_parameters_model()</a></li>
<li><a class="el" href="aialgo__sequential__training_8h.html#a62a55277765b0bdd5c88955eb92e4c13" title="Initialize the optimization memory of the model layers.">aialgo_init_model_for_training()</a></li>
<li><a class="el" href="aialgo__sequential__training_8h.html#a6557fccf302f653bcdcb77830463d14d" title="Perform one training epoch on all data batches of the dataset using backpropagation.">aialgo_train_model()</a></li>
<li><b>F32 specific</b><ul>
<li><a class="el" href="aialgo__sequential__training_8h.html#ab06a58b69f3136374e2dc6664f56e0c7" title="Calculate the loss in F32  data type.">aialgo_calc_loss_model_f32()</a></li>
</ul>
</li>
<li><b>Q31 specific</b><ul>
<li><a class="el" href="aialgo__sequential__inference_8h.html#a0b1aae54861650b0d6e80fc638a0b0ea" title="Initialize the quantization parameters of the layer results for Q31  data type.">aialgo_set_model_result_precision_q31()</a></li>
<li><a class="el" href="aialgo__sequential__inference_8h.html#a4d70260b376741a0cef4c42d41e705f8" title="Initialize the quantization parameters of the layer deltas for Q31  data type.">aialgo_set_model_delta_precision_q31()</a></li>
<li><a class="el" href="aialgo__sequential__inference_8h.html#a436e4f31e3a5498d033917db8277ff55" title="Initialize the quantization parameters of the gradients for Q31  data type.">aialgo_set_model_gradient_precision_q31()</a></li>
<li><a class="el" href="aialgo__sequential__training_8h.html#a9d2a18685d1db30e00c91c194bea8104" title="Calculate the loss in Q31  data type.">aialgo_calc_loss_model_q31()</a></li>
</ul>
</li>
<li><b>Advanced training controls</b><ul>
<li><a class="el" href="aialgo__sequential__training_8h.html#a20ba9e0bdcfd4e36bc1168789de7e99f" title="Set the gradients to zero.">aialgo_zero_gradients_model()</a></li>
<li><a class="el" href="aialgo__sequential__inference_8h.html#a4655caab3051cc837312c286fbe4789a" title="Perform a forward pass on the model.">aialgo_forward_model()</a></li>
<li><a class="el" href="aialgo__sequential__training_8h.html#aca4ec290b2db30cc76ad78aff649a69d" title="Perform the backward pass.">aialgo_backward_model()</a></li>
<li><a class="el" href="aialgo__sequential__training_8h.html#a4650ca244c2d5086eb80190d2416f86e" title="Perform the optimization step on the model parameters.">aialgo_update_params_model()</a></li>
</ul>
</li>
</ul>
<h2><a class="anchor" id="OverviewExpress"></a>
AIfES Express</h2>
<p>High level functions to build a simple multi layer perceptron / fully-connected neural network with a few lines of code.</p>
<ul>
<li><b>F32</b><ul>
<li><a class="el" href="aifes__express__f32__fnn_8h.html#a7cae69cea71af858ac246eb03f981ca0" title="Calculates the total required float weights for the selected network structure.">AIFES_E_flat_weights_number_fnn_f32()</a></li>
<li><a class="el" href="aifes__express__f32__fnn_8h.html#a51d3cc7a6d7da4fc0868cfd5bba340e8" title="Executes the inference.">AIFES_E_inference_fnn_f32()</a></li>
<li><a class="el" href="aifes__express__f32__fnn_8h.html#a63eb5f444593f469a115f8c34b0a5be0" title="Executes the training.">AIFES_E_training_fnn_f32()</a></li>
</ul>
</li>
<li><b>Q7</b><ul>
<li><a class="el" href="aifes__express__q7__fnn_8h.html#ac543551279494c6ce9709e4ee6f59104" title="Calculates the required length of the uint8_t array for the FNN.">AIFES_E_flat_weights_number_fnn_q7()</a></li>
<li><a class="el" href="aifes__express__q7__fnn_8h.html#a0518e913814f0ab2f04f75f3d47c495e" title="Quantizes the weights of an F32 FNN into a Q7 FNN.">AIFES_E_quantisation_fnn_f32_to_q7()</a></li>
<li><a class="el" href="aifes__express__q7__fnn_8h.html#a2bf3d2e767a7a1d9bef8a1a179e7324a" title="Executes the inference of a Q7 FNN.">AIFES_E_inference_fnn_q7()</a></li>
</ul>
</li>
</ul>
<h1><a class="anchor" id="autotoc_md4"></a>
Python tools</h1>
<p>To help you to get your neural network models from Python to AIfES and to perform the weights quantization to integer types, we provide some AIfES Python tools.</p>
<p>You can install the tools via pip from our GitHub repository with:</p>
<p><code>pip install <a href="https://github.com/Fraunhofer-IMS/AIfES_for_Arduino/raw/main/etc/python/aifes_tools.zip">https://github.com/Fraunhofer-IMS/AIfES_for_Arduino/raw/main/etc/python/aifes_tools.zip</a></code></p>
<p>You can have a look at the <a class="el" href="_tutorial_inference_q7.html#AutomaticQuantizationPython">automatic quantization example</a> to see how the Python tools can be used to quantize a model to Q7 integer type.</p>
<h1><a class="anchor" id="autotoc_md5"></a>
Structure and design concepts of AIfES</h1>
<p>AIfES was designed as a flexible and extendable toolbox for running and training or artificial neural networks on microcontrollers. All layers, losses and optimizers are modular and can be optimized for different data types and hardware platforms.</p>
<p>Example structure of a small FNN with one hidden layer in AIfES 2:</p>
<div class="image">
<img src="functional_concept.jpg" alt="" width="1000px"/>
</div>
<p>Modular structure of AIfES 2 backend:</p>
<div class="image">
<img src="math_module.jpg" alt="" width="1000px"/>
</div>
 </div></div><!-- PageDoc -->
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
